package com.lishe.lishe.lishe.module.excitation.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lishe.lishe.R;
import com.lishe.lishe.lishe.MyRecyclerView.RecyclerviewBaseAdapter;
import com.lishe.lishe.lishe.module.excitation.bean.company.SearchCompany;

import java.util.List;

/**
 * Created by DELL on 2017/10/26.
 */

public class SearchCompanyAdapter extends RecyclerviewBaseAdapter {

    private Context mContext;
    private List<SearchCompany> mList;

    public SearchCompanyAdapter(Context context, List<SearchCompany> list) {
        this.mContext = context;
        this.mList = list;
    }

    @Override
    public MyViewHolder onCreateViewHolderMy(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_textview, null);
        MyViewHolder holder = new MyViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolderMy(final RecyclerView.ViewHolder holder, int position) {
        SearchCompany searchCompany = mList.get(position);
        ((MyViewHolder)holder).name.setText(searchCompany.getComName());
    }

    @Override
    public int getItemCountMy() {
        return mList.size();
    }

    @Override
    public int getItemViewTypeMy(int position) {
        return 0;
    }

    class MyViewHolder extends RecyclerView.ViewHolder {
        private TextView name;

        public MyViewHolder(View itemView) {
            super(itemView);
            name = itemView.findViewById(R.id.text);
        }
    }


}
